package program.domain;

/**
 * @program: OSAlgorithms
 * @description: 空闲区
 * @author: Echo-dev
 * @create: 2021-11-05 11:58
 **/
public class Memory {

    /**
     * 起始地址
     */
    private int start;

    /**
     * 长度
     */
    private int length;

    /**
     * 分配的进程
     */
    private PCB pcb;

    public Memory(){}

    public Memory(int start, int length, PCB pcb) {
        this.start = start;
        this.length = length;
        this.pcb = pcb;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public PCB getPcb() {
        return pcb;
    }

    public void setPcb(PCB pcb) {
        this.pcb = pcb;
    }

    @Override
    public String toString() {
        return pcb.getPid()+"剩余时间:"+pcb.getNeedTime();
    }
}
